import { GCellRenderer } from "../../../../../com/mui/controls/GCellRenderer";
import { GTextFormat } from "../../../../common/GTextFormat";
import { ObjCreate } from "../../common/ObjCreate";
import { ImagesConst } from "../../../resource/ImagesConst";
import { TToplist } from "../../../../../Message/Db/Tables/TToplist";
import { ESex } from "../../../../../Message/Public/ESex";
import { Language } from "../../../../../extend/language/Language";
import { CareerConfig } from "../../../resource/CareerConfig";
import { ProxyConfig } from "../../../resource/ProxyConfig";
//class InterFloSimpleRenderer
    
    export  class InterFloSimpleRenderer extends GCellRenderer
    {
        constructor()
        {
            super();
            return;
        }

        protected /* override */ configUI(): void
        {
            super.configUI();
            var loc1=new GTextFormat("", 12, 16749973, null, null, null, null, null, flash.text.TextFormatAlign.CENTER);
            var loc2=new GTextFormat("", 12, 15788607, null, null, null, null, null, flash.text.TextFormatAlign.CENTER);
            this._rankTxt = ObjCreate.createTextField("", 65, 2, 20, 20, this, loc1);
            this._nameTxt = ObjCreate.createTextField("", 105, 2, 200, 20, this, loc1);
            this._sexTxt = ObjCreate.createTextField("", 320, 2, 50, 20, this, loc1);
            this._careerTxt = ObjCreate.createTextField("", 425, 2, 50, 20, this, loc1);
            this._serverTxt = ObjCreate.createTextField("", 505, 2, 100, 20, this, loc1);
            this._charmTxt = ObjCreate.createTextField("", 620, 2, 120, 20, this, loc2);
            this._vipBitmap = new Object /* flash.display.Bitmap */();
            var loc3=ObjCreate.createBg(0, 26, 750, 2, this, ImagesConst.SplitLine);
            return;
        }

        public /* override */ set data(arg1: Object)
        {
            var loc1=0;
            var loc2=0;
            var loc3=null;
            super.data = arg1;
            if (arg1) 
            {
                this._topList = arg1 as TToplist;
                this._rankTxt.htmlText = this._topList.rank + "";
                this._nameTxt.htmlText = this._topList.entityName;
                loc1 = _data.propertyTwo;
                if (loc1 != ESex._ESexMan) 
                {
                    if (loc1 == ESex._ESexWoman) 
                    {
                        this._sexTxt.htmlText = Language.getString(32077);
                    }
                }
                else 
                {
                    this._sexTxt.htmlText = Language.getString(32076);
                }
                loc2 = _data.propertyThree;
                loc3 = CareerConfig.instance.getInfoByCode(loc2).name;
                this._careerTxt.htmlText = loc3;
                this._serverTxt.htmlText = ProxyConfig.instance.getProxyName(this._topList.proxyId) + "·" + this._topList.serverId + Language.getString(36178);
                this._charmTxt.htmlText = this._topList.valueOne + "";
            }
            else 
            {
                this._rankTxt.htmlText = "";
                this._nameTxt.htmlText = "";
                this._sexTxt.htmlText = "";
                this._serverTxt.htmlText = "";
                this._charmTxt.htmlText = "";
            }
            return;
        }

        /* internal */ /* var */_rankTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_nameTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_sexTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_careerTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_serverTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_charmTxt: Object /* flash.text.TextField */;

        /* internal */ /* var */_vipBitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_topList: TToplist;
    }
